import request from '@/utils/request';

/**
 * 分页获取所有来源
 * @returns 
 */
export function findSupplierList(current,size,supplierVO){
    return request({
        url: '/biz/supplier/findSupplierList',
        method: 'post',
        /*localhost:8080/user?id=  方式传值*/
        params: {
          current,
          size
        },
        /*json数据传值*/
        data: supplierVO
      })
}

/**
 * 获取所有来源
 */
export function getAllSupplierList(){
    return request({
      url: '/biz/supplier/getAllSupplierList',
      method: 'get'
    })
}

/**
 * 删除来源
 * @param {*} id 
 */
export function deleteSupplierById(id){
  return request({
    url : '/biz/sipplier/deleteSupplierById',
    method : 'delete',
    params: {
      id
    }
  })
}

/**
 * 添加来源
 */
export function addSupplier(supplier){
  return request({
    url : '/biz/supplier/addSupplier',
    method : 'post',
    data: supplier
  })
}

export function updateSupplier(supplier){
  return request({
    url : '/biz/supplier/updateSupplier',
    method : 'post',
    data: supplier
  })
}

/**
 * 获取省份
 */
 export function getProvinces(){
    return request({
        url: '/json/provinces.json',
        method: 'get',
      })
}